package com.changgou.goods.feign;

import com.changgou.entity.Result;
import com.changgou.entity.StatusCode;
import com.changgou.goods.pojo.Sku;

import io.swagger.annotations.ApiParam;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @ClassName SkuFeign
 * @Description
 * @Author 传智播客
 * @Date 11:20 2019/11/15
 * @Version 2.1
 **/
@FeignClient(name = "goods-service")
@RequestMapping("/goods/sku")
public interface SkuFeign {

    @PostMapping(value = "/search")
    public Result<List<Sku>> findList(@RequestBody(required = false) Sku sku);


    @GetMapping("/findSkusByStatus/{status}")
    Result<List<Sku>> findSkusByStatus(@PathVariable(value = "status") String status);


    @GetMapping("/{id}")
    public Result<Sku> findById(@PathVariable("id") Long id);

    @PutMapping("/reduceStocks/{username}")
    public Result<Sku> reduceStocks(@PathVariable("username") String username);
}
